package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import view.PainelPrincipal;
import view.View;
import view.esporte.EsporteCadastro;
import view.esporte.EsportePesquisa;

public class PrincipalController implements ActionListener {

	private View visao;

	public void exibirTelaPrincipal() {
		visao = new PainelPrincipal();
		visao.exibir();
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getActionCommand().equals("sair")){
			if (JOptionPane.showConfirmDialog(null, "Deseja realmente sair?", "Sair do Sistema Clube Natalino", JOptionPane.OK_CANCEL_OPTION) == 0){
				System.exit(0);
			}
		}
		if (e.getActionCommand().equals("sobre")){
			JOptionPane.showMessageDialog(null, "versao: 1.0\nCopyright 2012\n\nAutor: Jailson & Patrick", "Sobre Sistema Clube Natalino", JOptionPane.INFORMATION_MESSAGE);
		}
		if (e.getActionCommand().equals("esporte")){
			//chamar tela de esporte
			View visao = new EsportePesquisa(this);
			visao.exibir();
		}
	}

}
